<%@ taglib uri="/WEB-INF/myfaces_html.tld" 	prefix="h" %>
<%@ taglib uri="/WEB-INF/myfaces_core.tld" 	prefix="f" %>
<%@ taglib uri="/WEB-INF/tomahawk.tld"     	prefix="t" %>
<%@ taglib uri="/WEB-INF/myfaces_sandbox.tld"   prefix="s" %>

<%@ page import="javax.faces.context.FacesContext" %>


<f:view >
    <jsp:include page="intestazione.jsp">
        <jsp:param name="titolo" value=":: Benvenuto ::" />
    </jsp:include>
    <script language="javascript" src="./script/tabledate.js"></script>
        

    <table  align="center">
        <br />
        <hr />
        <br />
        <tr width="100%" bgcolor="yellow">
            <td align ="left" width="250px">
                <a class="active" href="login.jsf">Login</a>     </td>   

            <td align ="left" width="400px">
            </td>  

            <td align ="right" width="250px">
            </td>   
        </tr>

        <tr width="100%">

            <td width="300px" align ="left">
                <t:saveState value="#{beanAppPrenotazione}"/>

                <h:form  >          
                    <table style="height: 80px; border: 2pt double orange;">
                        <tr>                   
                            <td colspan="2">
                                <t:selectOneRadio id="ar" value="#{beanAppPrenotazione.ar}" onchange="submit()">
                                    <f:selectItem itemValue="A" itemLabel="Solo Andata" />
                                    <f:selectItem itemValue="R" itemLabel="Andata/Ritorno"/>
                                </t:selectOneRadio>  
                            </td>
                        </tr> 

                        <tr>
                            <td class="etichettaDettaglio"><strong><t:outputLabel for="da" value="Da"/></strong></td>
                            <td>
                                <h:selectOneMenu id="da" value="#{beanAppPrenotazione.idComunePartenza}" onchange="submit()" >
                                    <f:selectItems value="#{beanAppPrenotazione.listaPartenze}" />
                                </h:selectOneMenu>           
                            </td>
                        </tr>
                        <tr>
                            <td class="etichettaDettaglio"><strong><t:outputLabel for="a" value="A"/></strong></td>
                            <td>
                                <h:selectOneMenu id="a" value="#{beanAppPrenotazione.idComuneArrivo}" >
                                    <f:selectItems value="#{beanAppPrenotazione.listaArrivi}" />
                                </h:selectOneMenu>           
                            </td>
                        </tr>

                        <tr> 
                            <td class="etichettaDettaglio"><strong><t:outputLabel for="dataPartenza" value="Data Partenza"/></strong></td>
                            <td><h:outputText value=" (gg/mm/aaaa)" style="font-size:6.5pt"/>
                                <br/>
                                <t:inputCalendar id="dataPartenza" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" size="10" styleClass="campoTesto" value="#{beanAppPrenotazione.dataPartenza}">
                                    <f:convertDateTime pattern="dd/MM/yyyy" type="both" timeZone="Europe/Rome"/>
                                </t:inputCalendar>
                                <h:message style="color: red" for="dataPartenza" showDetail="true" showSummary="false" />
                            </td>
                        </tr>   

                        <tr> 
                            <td class="etichettaDettaglio"><strong><t:outputLabel for="dataRitorno" value="Data Ritorno"/></strong></td>
                            <td><h:outputText value=" (gg/mm/aaaa)" style="font-size:6.5pt"/>
                                <br/>
                                <t:inputCalendar id="dataRitorno" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" size="10" styleClass="campoTesto" value="#{beanAppPrenotazione.dataRitorno}">
                                    <f:convertDateTime pattern="dd/MM/yyyy" type="both" timeZone="Europe/Rome"/>
                                </t:inputCalendar>
                                <h:message style="color: red" for="dataRitorno" showDetail="true" showSummary="false" />
                            </td>
                        </tr>  


                        <tr>                   
                            <td class="etichettaDettaglio"><strong><t:outputLabel for="num" value="Numero Passeggeri"/></strong></td>
                            <td><t:inputText id="numPasseggeri" value="#{beanAppPrenotazione.numPasseggeri}" styleClass="dettaglio_InputText" onchange="this.value=this.value.toUpperCase()" size="5" maxlength="2" required="true"/>
                                <h:message style="color: red" for="numPasseggeri" showDetail="true" showSummary="false" /></td>
                        </tr>  

                        <tr>                   
                            <td class="etichettaDettaglio"><strong><t:outputLabel for="dateFlessibili" value="Date Flessibili"/></strong></td>
                            <td><h:selectBooleanCheckbox id="dateFlessibili" value="#{beanAppPrenotazione.dataFlessibili}" styleClass="dettaglio_InputText" />
                                <h:message style="color: red" for="dateFlessibili" showDetail="true" showSummary="false" /></td>
                        </tr>  

                        <td>
                            <t:commandLink action="#{dettaglioPrenotazione.ricerca}"  value="Ricerca">
                            </t:commandLink>
                        </td>

                    </table>
                </h:form>   
                <h:form id="erroriDataBase" rendered="false">
                    <f:verbatim><table><td align="left" class="messaggiErrore" height="2px"></f:verbatim>           
                            <h:messages style="color: red" showDetail="true" showSummary="false"/>
                            <f:verbatim></td></table></f:verbatim>
                        </h:form>     
            </td>

            <td align ="center" height="280px" width="380px" bgcolor="#F4F6FA" style="border: 2pt double #1A4593;" background="image/sfondo00016.gif">
                <br />
            </td>

            <td width="300px" align ="right">
                <div  style="overflow:scroll; height: 480px; wrap: off">
                </div>
            </td>
        </tr>      
    </table>       
    <jsp:include page="piePagina.jsp"/>
</f:view>
